home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / AMIGA / AMICUS / AMICUS24.ADF / MonoLace / MonoLace.c < prev    next >
C/C++ Source or Header  |  1988-04-16  |  4KB  |  166 lines

  1. /* this program is the first program donated by me for public
  2. domain purposes.  It may be used as an Amigados utility and is partailly
  3. supported though Workbench. it changes an RGB screen monitor to your choice
  4. of popular color monocrome screens with the proper suffix. advantages of
  5. using this program over Preferences is that it is a quick short specific
  6. utillity that can easily be accessed though amigados; just put it in the c
  7. directory and it will be seconds away.
  8.   If anyone wishes to comment on it or wants to know how to get additional
  9. values for colors please feel free to call me at home 914-352-3498
  10.  
  11.                                                 -Steven Schafetz
  12.  
  13. Modifications for extended colors by Tony Solomon  PLINK ID  Tony*S
  14.  
  15.  
  16.  values for amber monocrome are color0= 0
  17.                                   color1=  3968
  18.                                   color2= 0
  19.                                   color3=  3968 (3652 if you want the cursor
  20.                                                     to stand out)
  21.  
  22.   values for green   pref    are color0=0
  23.                                  color1=656
  24.                                  color2=0  
  25.                                  color3=656
  26.  
  27.   values for yellow  pref    are color0=0
  28.                                  color1=3792
  29.                                  color2=0
  30.                                  color3=3792
  31.  
  32.  
  33.   values for default pref    are color0= 90
  34.                                  color1= 4095
  35.                                  color2= 2
  36.                                  color3= 3968
  37.  
  38.  */
  39. #include <intuition/intuition.h>
  40. #include <exec/types.h>
  41. #include <exec/tasks.h>
  42. #include <exec/libraries.h>
  43. #include <graphics/copper.h>
  44. #include <graphics/display.h>
  45. #include <graphics/gfxbase.h>
  46. #include <graphics/text.h>
  47. #include <graphics/view.h>
  48. #include <hardware/blit.h>
  49. #include <intuition/intuitionbase.h>
  50.  
  51. struct GfxBase *GfxBase;
  52. struct IntuitionBase *IntuitionBase;
  53. struct Preferences Pref, *pref;
  54.  
  55. main (argc,argv)
  56. char *argv[];
  57. short int argc;
  58. {
  59.    long int size;
  60.    GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 0);
  61.    if (GfxBase == NULL) exit(1000);
  62.  
  63.    if (!(IntuitionBase = (struct IntuitionBase *)
  64.                            OpenLibrary("intuition.library",0)) )
  65.    {
  66.       CloseLibrary(IntuitionBase);
  67.       printf("no intuition here!!\n");
  68.       exit(1);
  69.    }
  70.  
  71.  
  72.  size=sizeof(struct Preferences);
  73.  if (!( pref= GetPrefs(&Pref,size)))
  74.     printf("getprefs failed\n");
  75.  {
  76.  GfxBase->system_bplcon0 |=  INTERLACE;
  77.  RemakeDisplay();
  78.  RethinkDisplay();
  79.  }
  80.  
  81. if (argc==0)
  82.   *argv[1]='a';
  83.  
  84.   switch (*argv[1])
  85.  {
  86.  case 'a':
  87.    Pref.color0=0;
  88.    Pref.color1=3968;
  89.    Pref.color2=0;
  90.    Pref.color3=3968;
  91.    break;
  92.  
  93.  case 'n':
  94.    Pref.color0=90;
  95.    Pref.color1=4095;
  96.    Pref.color2=2;
  97.    Pref.color3=3968;
  98.    break;
  99.  
  100.  case 'g':
  101.    Pref.color0=0;
  102.    Pref.color1=656;
  103.    Pref.color2=0;
  104.    Pref.color3=656;
  105.    break;
  106.  
  107.  case 'y':
  108.   Pref.color0=0;
  109.   Pref.color1=3792;
  110.   Pref.color2=0;
  111.   Pref.color3=3792;
  112.   break;
  113.  
  114.  case 'o':
  115.   GfxBase->system_bplcon0 &= !INTERLACE;
  116.   break;
  117.  
  118.  case '1':
  119.   Pref.color0=2184;
  120.   Pref.color1=514;
  121.   Pref.color2=106;
  122.   Pref.color3=2896;
  123.   break;
  124.  case '2':
  125.   Pref.color0=256;
  126.   Pref.color1=80;
  127.   Pref.color2=1024;
  128.   Pref.color3=2912;
  129.   break;
  130.  case '3':
  131.   Pref.color0=0;
  132.   Pref.color1=1638;
  133.   Pref.color2=274;
  134.   Pref.color3=9;
  135.   break;
  136.  case '4':
  137.   Pref.color0=273;
  138.   Pref.color1=1638;
  139.   Pref.color2=1281;
  140.   Pref.color3=356;
  141.   break;
  142.  case '5':
  143.   Pref.color0=4;
  144.   Pref.color1=1365;
  145.   Pref.color2=7;
  146.   Pref.color3=2336;
  147.   break;
  148.  case '6':
  149.   Pref.color0=2457;
  150.   Pref.color1=546;
  151.   Pref.color2=1387;
  152.   Pref.color3=9;
  153.   break;
  154.  
  155.  default:
  156.    puts("usage a/amber g/green y/yellow n/normal o/Lace Off 1-6/PreSet Colors");
  157.    exit(0);
  158.   }
  159.  
  160.  if (!( pref = SetPrefs(&Pref,size,TRUE)))
  161.     printf("setprefs failed\n");
  162.  
  163.  CloseLibrary(IntuitionBase);
  164.  CloseLibrary(GfxBase);
  165. }
  166.